package com.explorx.sns.puma.im.core.common.exceptions;

import com.explorx.sns.puma.im.core.chat.consts.CheckPrivilegeResultEnum;

public class BizException extends Exception{

    private int code;
    private String desc;

    public BizException(String message, int code, String desc) {
        super(message);
        this.code = code;
        this.desc = desc;
    }

    public BizException(String message, Throwable cause, int code, String desc) {
        super(message, cause);
        this.code = code;
        this.desc = desc;
    }

    public BizException(CheckPrivilegeResultEnum checkResult) {
        super(checkResult.getDesc());
        this.code = checkResult.getCode();
        this.desc = checkResult.getDesc();
    }
}
